package birdsong.client;

/**
 * User class, for each user in list.
 * 
 * @author Joao Paulo & Omar Oliveira
 * 
 */
public class User {

    private String name;
    private Status estado;

    
    public User(String name, Status estado) {
    	this.setName(name);
    	this.setEstado(estado);
    }

    /**
     * @param name
     *            the name to set
     */
    public void setName(String name) {
    	this.name = name;
    }

    /**
    * @return the name
    */
    public String getName() {
    	return name;
    }

    /**
     * @param estado
     *            the estado to set
     */
    public void setEstado(Status estado) {
	this.estado = estado;
    }

    /**
     * @return the estado
     */
    public Status getEstado() {
	return estado;
    }

    @Override
    /**
     * To String method, to print name in Jlist.
     * If is FOLLOW then add -> in the beginning of the name.
     * If is FOLLOWED then add <- in the beginning of the name.
     * If is FOLLOW_FOLLOWED then add <> in the beginning of the name.
     * If is FOLLOWED_FOLLOW then add <> in the beginning of the name.
     * else add 2 spaces in the beginning
     */
    public String toString() {
    	switch (estado) {
    		case FOLLOW:
    			return "->" + this.name;
    		case FOLLOWED:
    			return "<-" + this.name;
    		case FOLLOW_FOLLOWED:
    			return "<>" + this.name;
    		case FOLLOWED_FOLLOW:
    			return "<>" + this.name;
    		default:
    			return "  " + this.name;
    	}
    }

}
